﻿using System;

namespace TrueSync.Physics2D
{
    public struct BroadphaseProxy
    {
        public AABB AABB;
        public Fixture Fixture;
        public int ProxyId;
    }

    public interface IBroadphase
    {
        int ProxyCount { get; }

        void UpdatePairs(BroadphaseDelegate callback);

        bool TestOverlap(int proxyIdA, int proxyIdB);

        int AddProxy(BroadphaseProxy proxy);

        void RemoveProxy(int proxyId);

        void MoveProxy(int proxyId, AABB aabb);

        BroadphaseProxy GetProxy(int proxyId);

        void TouchProxy(int proxyId);

        void GetFatAABB(int proxyId, out AABB aabb);

        void Query(Func<int, bool> callback, AABB aabb);

        void RayCast(Func<RayCastInput, int, FP> callback, RayCastInput input);

        void ShiftOrigin(TSVector2 newOrigin);
    }
}

